<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.org/thymeleaf/shiro">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximumscale=1">
    <title>layui布局</title>
    <!--第一步，引入layui的资源-->
    <link rel="stylesheet" th:href="@{/resources/layui/css/layui.css}">
</head>
<body>
<input type="hidden" id="userId" >
<!--在body下引入js资源-->
<script th:src="@{/resources/layui/layui.js}"></script>
<form class="layui-form" action=" " id="applyList" th:inline="none">

    <div class="layui-form-item">
        <label class="layui-form-label">用车理由</label>
        <div class="layui-input-block">
            <input type="text" id="reason"  name="reason" required  lay-verify="required" placeholder="请输入用车原因" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">开始时间</label>
        <div class="layui-input-block">
            <input type="Date"  id="starttime" name="starttime" required  lay-verify="required" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">结束时间</label>
        <div class="layui-input-block">
            <input type="Date" id="endtime" name="endtime"  required  lay-verify="required" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">用车前往目的地</label>
        <div class="layui-input-block">
            <input type="text" id="destination"  name="destination" required  lay-verify="required" placeholder="请输入目的地" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">用车人数</label>
        <div class="layui-input-block">
            <input type="text" id="peoplenum" name="peoplenum" required  lay-verify="required" placeholder="请输入人数" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item layui-form-text">
    <label class="layui-form-label">备注信息</label>
    <div class="layui-input-block">
        <textarea  id="information" name="information" placeholder="请输入内容" class="layui-textarea"></textarea>
    </div>
</div>

</form>
<!--开始写，layui的资源-->
<script th:inline="none">//此处有坑，需要设置“th:inline="none"”
//一般直接写在一个js文件中
//同时，在layui中引入table表格
layui.use(['layer', 'form', 'table'], function () {
    var layer = layui.layer
        , form = layui.form
        , table = layui.table
        , $ = layui.jquery;
});
var callbackdata=function(){
    //var checkStatus = layui.table.checkStatus('applyList');
    //返回值没有data的话父页面拿不到id的值
    var reason=document.getElementById('reason').value;
    var endtime=document.getElementById('endtime').value;
    var starttime=document.getElementById('starttime').value;
    var destination=document.getElementById('destination').value;
    var peoplenum=document.getElementById('peoplenum').value;
    var information=document.getElementById('information').value;
    var userId=document.getElementById('userId').value;
    var obj={
        reason:reason,
        starttime:starttime,
        endtime:endtime,
        destination:destination,
        peoplenum:peoplenum,
        information:information,
        uid:userId,
    }
    return obj;
}
    //引入jquery
</script>
</body>
</html>